package cn.com.bsoft.wePortal.message.service

import cn.com.bsoft.wePortal.msg.service.MessagePublisher
import org.springframework.data.redis.core.StringRedisTemplate
import org.springframework.data.redis.listener.ChannelTopic

class RedisMessagePublisher: MessagePublisher {

    lateinit var topic:ChannelTopic

    lateinit var redisTemplate:StringRedisTemplate

    override fun publish(msg: String) {
        redisTemplate.convertAndSend(topic.topic,msg)
    }

}